﻿using System;
using System.Linq;
using System.Collections.Generic;
using WS.EKA.ServiceInterface;
using WS.EKA.DataAccess;
using WS.EKA.Utilities.Consts;

namespace WS.EKA.ServiceImpl
{
    public class MemberMessageService : IMemberMessage
    {
        public List<Model.MemberMessage> Get(string receiveMemLoginID, int pageIndex,out int recordTotal)
        {
            return MemberMessageContext.GetByPage(pageIndex, PagerConst.PageSize,t=>t.ReceiveMemLoginID== receiveMemLoginID
                , x => x.OrderByDescending(t => t.CreateTime), out recordTotal);
        }

        public int IsReaded(Guid guid, string memLoginID)
        {
            return MemberMessageContext.IsReaded(guid, memLoginID);
        }

        public int Delete(Guid guid, string memLoginID)
        {
            return MemberMessageContext.Delete(guid, memLoginID);
        }
    }
}
